package org.example.controller;

import org.example.entity.User;
import org.example.service.UserService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;

/**
 * TODO 类功能介绍及重点或容易混淆点的说明。
 *
 * @version 1.0 2023/5/20 10:26 龙小南 新建类[说明]
 * @author: 龙小南
 * @Date: 2023/5/20 10:26
 * @Version 1.0[当前版本号]
 */
@Validated
@RestController
@RequestMapping("/users")
public class UserController {

    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    /** ##### 参数校验 ####  start  ########## */
    @PostMapping("/")
    public User createUser(@RequestBody @Validated User user){
        return userService.createUser(user);
    }

}
